#include "homepage.h"

HomePage::HomePage( QWidget* parent ) : QWidget( parent )
{
    this->initView();
}

void HomePage::initView()
{
    this->m_SummaryPanel  = new SummaryPanel( 8, this );
    this->m_CapacityPanel = new CapacityPanel( this );
    this->m_FuncBtnPanel  = new FunctionButtonsPanel( this );
    this->m_MapPanel      = new MapPanel( this );
    this->m_PlotsPanel    = new PlotsPanel( this );
    QVBoxLayout* leftLay  = new QVBoxLayout;
    QVBoxLayout* rightLay = new QVBoxLayout;
    QHBoxLayout* layout   = new QHBoxLayout;

    leftLay->addStretch( 1 );
    leftLay->addWidget( this->m_SummaryPanel );
    leftLay->addWidget( this->m_CapacityPanel );
    leftLay->addWidget( this->m_FuncBtnPanel );
    leftLay->addStretch( 1 );

    rightLay->addStretch( 1 );
    rightLay->addWidget( this->m_MapPanel );
    rightLay->addWidget( this->m_PlotsPanel );
    rightLay->addStretch( 1 );

    layout->addStretch( 1 );
    layout->addLayout( leftLay );
    layout->addStretch( 1 );
    layout->addLayout( rightLay );
    layout->addStretch( 1 );

    this->setLayout( layout );
}
